# -*- coding: utf-8 -*-

class MakersController < ApplicationController
  def index
    @title = "蔵元検索"
    @subtitle = "読みまたは漢字を入力してください。途中まででも可。"
  end

  def search
    @makers = Maker.find(:all, :conditions => ["name_yomi like ? or name like ?", "#{params[:maker_name]}%", "#{params[:maker_name]}%"])

    @title = "蔵元検索"
    @subtitle = params[:maker_name]
  end
  
  def detail
    @maker = Maker.find(params[:id])
    @products = Product.where(:maker => params[:id], :is_show => true).all

    @title = "蔵元詳細"
    @subtitle = @maker.name + "（" + @maker.name_yomi + "）の紹介"
  end
end
